#include "RegexMatcher.h"

#include <string.h>
#include <fan-llvm/core/Core.h>
#include "Type.h"
#include "UnsupportedErr.h"


Type* RegexMatcher_classType = NULL;
VTable* RegexMatcher_classVTable = NULL;


/**********************************************
 *
 * Methods and fields
 *
 **********************************************/


/* Bool matches() */
Bool RegexMatcher_matches(RegexMatcher* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.matches not implemented yet"));
}


/* Bool find() */
Bool RegexMatcher_find(RegexMatcher* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.find not implemented yet"));
}


/* Int groupCount() */
Int RegexMatcher_groupCount(RegexMatcher* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.groupCount not implemented yet"));
}


/* Str? group(Int group) */
Str* RegexMatcher_group_0(RegexMatcher* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.group not implemented yet"));
}


/* Str? group(Int group) */
Str* RegexMatcher_group(RegexMatcher* self, Int group)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.group not implemented yet"));
}


/* Int start(Int group) */
Int RegexMatcher_start_0(RegexMatcher* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.start not implemented yet"));
}


/* Int start(Int group) */
Int RegexMatcher_start(RegexMatcher* self, Int group)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.start not implemented yet"));
}


/* Int end(Int group) */
Int RegexMatcher_end_0(RegexMatcher* self)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.end not implemented yet"));
}


/* Int end(Int group) */
Int RegexMatcher_end(RegexMatcher* self, Int group)
{
  exceptionThrow(UnsupportedErr_newWithFormattedMsg("sys::RegexMatcher.end not implemented yet"));
}


/**********************************************
 *
 * Type-system functions
 *
 **********************************************/


Type* RegexMatcher_initType(void)
{
  if (RegexMatcher_classType == NULL)
  {
    Type* baseType = Obj_initType();
    VTable* vtable = RegexMatcher_initVTable();
    Type* type = Type_new("RegexMatcher", baseType, vtable, sizeof(RegexMatcher), sizeof(RegexMatcherVTable));
    Type_registerMethodImplementation(type, "end", RegexMatcher_end_0, 0);
    Type_registerMethodImplementation(type, "end", RegexMatcher_end, 1);
    Type_registerMethodImplementation(type, "find", RegexMatcher_find, 0);
    Type_registerMethodImplementation(type, "group", RegexMatcher_group_0, 0);
    Type_registerMethodImplementation(type, "group", RegexMatcher_group, 1);
    Type_registerMethodImplementation(type, "groupCount", RegexMatcher_groupCount, 0);
    Type_registerMethodImplementation(type, "matches", RegexMatcher_matches, 0);
    Type_registerMethodImplementation(type, "start", RegexMatcher_start_0, 0);
    Type_registerMethodImplementation(type, "start", RegexMatcher_start, 1);
    RegexMatcher_classType = type;
    RegexMatcher_initStatic();
  }
  return RegexMatcher_classType;
}


VTable* RegexMatcher_initVTable(void)
{
  if (RegexMatcher_classVTable == NULL)
  {
    VTable* vtable = memoryAlloc(sizeof(RegexMatcherVTable));
    memcpy(vtable, Obj_initVTable(), sizeof(FanObjVTable));
    RegexMatcher_classVTable = vtable;
  }
  return RegexMatcher_classVTable;
}


void RegexMatcher_initStatic(void)
{
}
